package tut.designParttern.design.singleton.source;

public class DatabaseThread {
	private static DatabaseThread singleObject = new DatabaseThread("products");
	private int record;
	private String name;

	private DatabaseThread(String n) {
		this.name = n;
		this.record = 0;
	}

	public static DatabaseThread getInstance(String n){
		return singleObject;
	}

	public void editRecord(String operation){
		System.out.println("Perform a " + operation + " in record "
				+ this.record + " in database " + this.name);
	}

	public String getName(){
		return this.name;
	}
}
